package rtool

import "strings"

// HtmlEscapeSequence 进行HTML转义字符串替换
func HtmlEscapeSequence(content string) string {
	content = strings.ReplaceAll(content, `"`, "&quot;")
	content = strings.ReplaceAll(content, `&`, "&amp;")
	content = strings.ReplaceAll(content, `<`, "&lt;")
	content = strings.ReplaceAll(content, `>`, "&gt;")
	content = strings.ReplaceAll(content, ` `, "&nbsp;")
	return content
}

// HtmlEscapeSequence2 进行HTML转义字符串替换
func HtmlEscapeSequence2(content string) string {
	content = strings.ReplaceAll(content, `&`, "&amp;")
	content = strings.ReplaceAll(content, `<`, "&lt;")
	content = strings.ReplaceAll(content, `>`, "&gt;")
	return content
}
